#include "atomic_0701_dandaoxx.h"

// 生成随机预设轨迹数据
int generate_random_trajectory(BallisticInformationInput *input, BallisticInformationOutput *output)
{
    static std::mt19937 rng(std::random_device{}());

    // 定义各参数的合理范围
    std::uniform_real_distribution<double> lat_dist(-90.0, 90.0);       // 纬度
    std::uniform_real_distribution<double> lon_dist(-180.0, 180.0);     // 经度
    std::uniform_real_distribution<double> alt_dist(0.0, 30000.0);      // 高度 (m)
    std::uniform_real_distribution<double> vel_dist(0.0, 1000.0);       // 速度 (m/s)
    std::uniform_real_distribution<double> heading_dist(0.0, 360.0);    // 航向 (度)
    std::uniform_real_distribution<double> max_vel_dist(500.0, 2000.0); // 最大速度 (m/s)
    std::uniform_real_distribution<double> max_accel_dist(5.0, 50.0);   // 最大加速度 (m/s²)
    std::uniform_real_distribution<double> time_dist(0.0, 86400.0);     // 时间戳 (秒)

    // 当前状态
    output->current_latitude = lat_dist(rng);
    output->current_longitude = lon_dist(rng);
    output->current_altitude = alt_dist(rng);
    output->current_velocity = vel_dist(rng);
    output->current_heading = heading_dist(rng);

    // 目标状态
    output->target_latitude = lat_dist(rng);
    output->target_longitude = lon_dist(rng);
    output->target_altitude = alt_dist(rng);

    // 性能参数
    output->max_velocity = max_vel_dist(rng);
    output->max_acceleration = max_accel_dist(rng);

    // 时间戳
    output->timestamp = time_dist(rng);

    return ATOMIC_SERVICE_SUCCESS;
}